<%@ include file="/WEB-INF/views/public/include.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<!-- 页面编码 -->
	<meta charset="utf-8">
  	<!-- 手机浏览器禁止缩放, 页面大小默认为手机屏幕宽度 -->
  	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
  	<!-- 允许IOS全屏显示网页 -->
  	<meta content="yes" name="apple-mobile-web-app-capable" />
  	<!-- 设置IOS状态栏为透明底色 -->
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<!-- 设置360浏览器渲染引擎为webkit -->
  	<meta name="renderer" content="webkit">
  	<!-- 设置APP标题 -->
  	<meta name="apple-mobile-web-app-title" content="青年电影志">
  	<!-- 关闭自动识别电话号码 -->
  	<meta name="format-detection" content="telephone=no">
	<!-- iPhone桌面图标 -->
	<link href="/resources/static/images/app-60@2x.png" sizes="120x120" rel="apple-touch-icon-precomposed">
  	<!-- 页面标题 -->
  	<title>评价</title>
  	<!-- 基本样式载入 -->
  	<link rel="stylesheet" href="/resources/static/css/ionicons.min.css">
	<link rel="stylesheet" href="/resources/static/css/public.css">
	<link rel="stylesheet" href="/resources/static/css/starrr.css">
	<!-- 基本脚本载入 -->
	<script src="/resources/static/js/plugins.min.js"></script>
</head>
<body>
	<div id="app" class="site" data-controller="homePage">
		<div class="bar bar-footer bar-primary">
			<a role="button" class="nav-btn js-confirm"><i class="ion-chatbubbles"></i>提交评价</a>
			<!-- END .bar-navigation -->
		</div>
		<div id="content" class="site-content">
			<div class="inner">
				<div class="review-head">
					<div class="people-avatar">
						<img src="${application.user.picUrl}" alt="">
						<span class="people-name">${application.user.getName()}</span>
					</div>
					<!-- END .people-avatar -->
					<div class="people-content">
						<h3 class="people-title">${application.subjectTitle}</h3>
						<span class="people-pos">${application.user.profession}</span>
						<div class="people-meta">
							<div class="starrr" data-rating='${comment.evaluation}'></div>
						</div>
						<!-- END .people-meta -->
					</div>
					<!-- END .people-content -->
				</div>
				<!-- END .review-head -->
				<form:form commandName="comment" action="./comment.do?applicationId=${application.id}" class="wizard-form" method="post">
					<form:input path="evaluation" type="hidden" id="stars" />
					<div class="wizard-step is-active">
						<div class="form-group">
							<label class="control-label">评价<span>*</span></label>
							<form:textarea path="content" class="form-control js-required" rows="10" placeholder="请把想说的话写在这里吧"></form:textarea>
						</div>
						<!-- END .form-group -->
					</div>
				</form:form>
			</div>
			<!-- END .inner -->
		</div>
		<!-- END #content -->
	</div>
	<!-- END #page -->
	<!-- 页面脚本载入 -->
	<script src="/resources/static/js/app.js"></script>
	<script src="/resources/static/js/vendors/starrr.js"></script>
	<script>
		(function($) {
			$('.starrr').on('starrr:change', function(e, value){
				$('#stars').val(value);
			});

			$('.js-confirm').on('click', function(event) {
				event.preventDefault();
				if($('.js-content').val() == '') {
					alert('请填写评价!');
				} else {
					$('.wizard-form').submit();
				}
			});
		})(Zepto);
	</script>
</body>
</html>